/* AI聊天弹窗样式 */
.ai-chat-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 9999;
    color: white;
}

.ai-chat-fab:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.ai-chat-fab i {
    font-size: 24px;
    margin-bottom: 2px;
}

.ai-chat-fab .fab-text {
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* AI聊天弹窗 */
.ai-chat-modal {
    z-index: 10000;
}

.ai-chat-content {
    width: 500px;
    max-width: 90vw;
    height: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.ai-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-chat-header h3 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-chat-close {
    color: white !important;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-chat-close:hover {
    transform: scale(1.1);
}

.ai-chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    max-height: 400px;
}

.ai-message, .user-message {
    margin-bottom: 15px;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-message .message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 85%;
}

.ai-message .message-content i {
    color: #667eea;
    margin-top: 2px;
    flex-shrink: 0;
}

.user-message .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 18px 18px 4px 18px;
    margin-left: auto;
    max-width: 85%;
    text-align: right;
}

.ai-chat-input-area {
    border-top: 1px solid #e9ecef;
    background: white;
    padding: 15px 20px;
}

.ai-chat-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 10px;
}

.ai-chat-input-container {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#ai-chat-input {
    flex: 1;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    resize: none;
    outline: none;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

#ai-chat-input:focus {
    border-color: #667eea;
}

.ai-send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    white-space: nowrap;
}

.ai-send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.ai-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 加载状态 */
.ai-loading {
    display: flex;
    align-items: center;
    gap: 5px;
    font-style: italic;
    color: #6c757d;
}

.ai-loading::after {
    content: '';
    width: 0;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0%, 60%, 100% { content: ''; }
    20% { content: '.'; }
    40% { content: '..'; }
    80% { content: '...'; }
}

/* AI设置页面样式 */
.ai-settings-container {
    padding: 20px;
}

.ai-models-section, .ai-limits-section, .ai-system-section {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.ai-models-section h3, .ai-limits-section h3, .ai-system-section h3 {
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.models-list {
    margin-top: 15px;
}

.model-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.model-info h4 {
    margin: 0 0 5px 0;
    color: #333;
}

.model-info p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

.model-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: bold;
}

.model-status.active {
    background: #d4edda;
    color: #155724;
}

.model-status.inactive {
    background: #f8d7da;
    color: #721c24;
}

.model-actions {
    display: flex;
    gap: 10px;
}

.limit-settings, .system-settings {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-user-section {
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
    margin-top: 15px;
}

.user-results {
    margin-top: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.user-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-info h5 {
    margin: 0 0 5px 0;
    color: #333;
}

.user-info p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

.limit-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.limit-controls input {
    width: 80px;
    padding: 5px 8px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .ai-chat-fab {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    .ai-chat-fab i {
        font-size: 20px;
    }
    
    .ai-chat-fab .fab-text {
        font-size: 8px;
    }
    
    .ai-chat-content {
        width: 95vw;
        height: 70vh;
    }
    
    .ai-chat-input-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ai-send-btn {
        align-self: flex-end;
        margin-top: 10px;
    }
}

.ai-model-selector {
    margin-left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-model-selector label {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
}

.ai-model-selector select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    background: white;
    min-width: 120px;
}

.ai-chat-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 12px;
    color: #666;
}
  